﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JSC.Portal.Entities.Interfaces;

namespace JSC.Portal.Entities
{
    public partial class PortalSite : DescriptiveEntity, ITracked, IValid
    {
        public new bool CanDelete
        {
            get
            {
                return (base.CanDelete && PortalPages.Count == 0);
            }
        }

        public bool CanCreatePortalPage
        {
            get
            {
                var page = PortalPages.FirstOrDefault(pp => pp.Parent == null);
                return (page == null && Id > 0);
            }
        }
    }
}
